from django.contrib import admin
from django.urls import path, include
from users.urls import *
from rest_framework_simplejwt.views import TokenObtainPairView
from users.views import Login, RegisterView, UserView
from rest_framework_simplejwt.views import TokenRefreshView,TokenVerifyView

urlpatterns = [
    path('login/', Login.as_view),
    path('register/', RegisterView.as_view),
    path('user/', UserView.as_view),
    # 刷新token
    path('token/refresh/', TokenRefreshView.as_view),
    # 校验token
    path('token/verify/', TokenVerifyView.as_view),
    # 获取单个信息的路由
    path('users/<int:pk>/', UserView.as_view({'get': 'retrieve'})),
    # 上传图片
    path('<int:pk>/avatar/upload/', UserView.as_view({'post': 'upload_avatar'}))

]
